import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:lenovo
 * Date:2024-06-02
 * Time:22:20
 */
public class Test1 {
    //给定一个长度为n的字符串，返回这个字符串包含的大小写字符，并根据它们的顺序拼接成一个新字符串
    public static String solution(String input){
        StringBuilder str=new StringBuilder();
        for (int i = 0; i < input.length(); i++) {
            char ch=input.charAt(i);

            if (Character.isUpperCase(ch) || Character.isLowerCase(ch)) {
                if (!str.toString().contains(String.valueOf(ch))) {
                    str.append(ch);
                }
            }
        }
        return str.toString();
    }

    public static void main(String[] args) {
        System.out.println("请输入：");
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        String result = solution(input);
        System.out.println(result);
    }
}
